{template 'common/header'}

<form class="table-top-search form-inline" id="search_table" method="GET" action="#">
<div class="btn-group" role="group" aria-label="...">
    <a class="btn btn-default" href="{php echo wurl('site/entry', array('et' => 2, 'eid' => $_GET['eid'], 'version_id'=>0))}" role="button">新增</a>
    <a class="btn btn-default" href="javascript:;" role="button" id="del">删除</a>
    <a class="btn btn-default" role="button">保存</a>
    <a href="javascript:;" type="checkbox" class="btn btn-default" onclick="checkall(this, '.check-all')" data-checked="0">全选</a>
</div>
</form>

<form name="acform" method="post" id="sortform" action="{php echo aurl(6)}">
    <table class="table">
        <thead>
            <tr>
                <td>#</td>
                <td>编号</td>
                <td>类别名称</td>
                <td>操作</td>
            </tr>
        </thead>
        {loop $sql1 $item}
        <tfoot>
            <tr>
                <td>
                    <input type="checkbox" name="checkname[]" class="check-all" value="{$item['uid']}">
                </td>
                <td>{php echo $item['uid']}</td>
                <td>{php echo $item['sortname']}</td>
                <td><a type="submit" class="btn btn-default" href="{php echo wurl('site/entry',array('uid'=>$item['uid'],'version_id'=>0,'et'=>4,'eid'=>2))}"} role="button">修改</a>
                </td>
            </tr>
        </tfoot>
        {/loop}
    </table>
</form>
{$html}


<script type="text/javascript">
    function checkall(_this,dom) {
        var isCheck = $(_this).attr('data-checked');
        if(isCheck == '0') {
            $(dom).prop('checked',true);
            $(_this).attr('data-checked','1');
        }else {
            $(dom).prop('checked',false);
            $(_this).attr('data-checked','0');
        }
    }
    $('#del').on('click',function() {
        $('#sortform').submit();
    })
</script>
{template 'common/footer'}